package com.qingzhou.web.repository.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.handler.Fastjson2TypeHandler;
import com.qingzhou.common.web.domain.BaseEntity;
import com.qingzhou.common.web.domain.FileVo;
import com.qingzhou.web.service.impl.convert.DictParent;
import com.qingzhou.web.service.impl.convert.MaterialsConverter;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;
import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
@Table(value = "edc_collect")
public class CollectEntity extends BaseEntity {
    @Id
    private Long id;

    @ApiModelProperty(value = "状态")
    private String status;

    @ApiModelProperty(value = "患者编号")
    private String patientCode;

    @ApiModelProperty(value = "子产品线")
    @DictParent("sub_product_line")
    private String subProductLine;

    @ApiModelProperty(value = "样本编号")
    private String sampleNo;

    @ApiModelProperty(value = "样本名称")
    private String sampleName;

    @ApiModelProperty(value = "送检材料")
    @Column(typeHandler = Fastjson2TypeHandler.class)
    @ExcelProperty(value = "送检材料",converter = MaterialsConverter.class)
    private List<String> materials;

    @ApiModelProperty(value = "采样日期")
    @DateTimeFormat()
    private Date collectDate;

    @ApiModelProperty(value = "收样日期")
    @DateTimeFormat()
    private Date receiveDate;

    @ApiModelProperty(value = "检测时间")
    @DictParent("test_time_dict")
    private String testDate;

    @ApiModelProperty(value = "送样人员")
    @DictParent("delivery_person_dict")
    private String deliveryPerson;

    @ApiModelProperty(value = "接收人员")
    @DictParent("receive_person_dict")
    private String receivePerson;

    @ApiModelProperty(value = "是否合格")
    @DictParent("sys_yes_no")
    private String isQualified;

    @ApiModelProperty("数据检查原因")
    private String editReason;

    @ApiModelProperty("终止原因")
    private String stopReason;

    @ApiModelProperty("组学类型")
    @DictParent("types_omics_dict")
    private String omicsType;

//    @ApiModelProperty(value = "预计报告日期")
//    @DateTimeFormat()
//    private Date expectedReportDate;

    @ApiModelProperty("报告文件")
    @Column(typeHandler = Fastjson2TypeHandler.class)
    private FileVo reportFile;

    @ApiModelProperty("MRD阳性阴性结果")
    @DictParent("mrd_check_result")
    private String checkResult;
}
